From 81406fdf2e0b99180116008d56466659f27d0e37 Mon Sep 17 00:00:00 2001 From: Robert Lipe Date: Tue, 31 Jul 2018 04:08:28 -0500 Subject: [PATCH] Final presubmit cleanups MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Ship it when it’s green. (and it’s tomorrow, errr, today.) --- vecs.cc | 1 - xcsv.cc | 28 ++++++---------------------- 2 files changed, 6 insertions(+), 23 deletions(-) diff --git a/vecs.cc b/vecs.cc index 3841195dd..3d32e855a 100644 --- a/vecs.cc +++ b/vecs.cc @@ -24,7 +24,6 @@ #include "gbversion.h" #include "inifile.h" #include -#include #include // qsort #define MYNAME "vecs.c" diff --git a/xcsv.cc b/xcsv.cc index b0f3d3024..ee147a927 100644 --- a/xcsv.cc +++ b/xcsv.cc @@ -163,6 +163,8 @@ xcsv_destroy_style(void) xfree(xcsv_file.ofield); } } + xcsv_file.ifields.clear(); + xcsv_file.ofields.clear(); /* other alloc'd glory */ xcsv_file.field_delimiter = QString(); @@ -343,24 +345,14 @@ xcsv_parse_style_line(QString line) Fatal() << "Invalid IFIELD line: " << tokenstr; } - // The key ("LAT_DIR") should never contain quotes. + // The key ("LAT_DIR") should never contain quotes. - - // No, I don't know why these are comma-separated AND quoted. - // There may be a regex way to remove only the - // outermost quote, but leave remaining ones. - // This is required for formats like tomtom_asc - // that uses ... ""%s"" - and relies on the quotes. - // This probably works quite badly if there's a quote - // in the output stream, but this is emulating what - // the previous pointer-bashing did for 15+ years. const char* key = xstrdup(tokens[0].simplified()); QString s1 = dequote(tokens[1]); char* val = xstrdup(s1); QString s2 = dequote(tokens[2]); char* pfc = xstrdup(s2); - //dconst char* key = xstrdup(fields[0].simplified()); xcsv_ifield_add(key, val, pfc); } else @@ -376,25 +368,17 @@ xcsv_parse_style_line(QString line) Fatal() << "Invalid OFIELD line: " << tokenstr; } - // The key ("LAT_DIR") should never contain quotes. + // The key ("LAT_DIR") should never contain quotes. const char *key = xstrdup(tokens[0].simplified()); - // No, I don't know why these are comma-separated AND quoted. - // There may be a regex way to remove only the - // outermost quote, but leave remaining ones. - // This is required for formats like tomtom_asc - // that uses ... ""%s"" - and relies on the quotes. - // This probably works quite badly if there's a quote - // in the output stream, but this is emulating what - // the previous pointer-bashing did for 15+ years. QString s1 = dequote(tokens[1]); char *val = xstrdup(s1); QString s2 = dequote(tokens[2]); const char* pfc = xstrdup(s2); - // This is pretty lazy way to parse write options. - // They've very rarely used, so we'll go for simple. + // This is pretty lazy way to parse write options. + // They've very rarely used, so we'll go for simple. if (tokens.size() > 4) { QString options_string = tokens[3].simplified(); if (options_string.contains("no_delim_before")) { -- 2.30.2